<%--
  Created by IntelliJ IDEA.
  User: 75230
  Date: 2022-9-2
  Time: 10:31
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>

<script src="/js/jquery-1.11.0.js"></script>

<script>

    $(function () {

        $("#id1").click(
            function () {
                $("#id2").val("测试成功")
            }
        )

        $("#id2").blur(
            function () {
                $("#id2").val("失去焦点了")
            }
        )

        $("#id2").focus(
            function () {
                $("#id2").val("获得焦点了")
            }
        )

        $("#id3").dblclick(
            function () {
                $("#id2").val("双击事件")
            }
        )

        $("#ajax1").click(
            function () {
                $.ajax({
                    url:"/h/test3",
                    type:"POST",
                    data:'{"name":"Rorschach","age":20}',
                    dataType:"json",
                    contentType:"application/json;charset=UTF-8",
                    success:function (data) {
                        $("#ajaxtext").val(data.name)
                    }
                })
            }
        )



    });
</script>


<body>
    <h1>hello  springmvc</h1>
    <input type="text" id="ajaxtext"placeholder="测试异步">
    <input type="button" id="ajax1" value="ajax">
    -----------------------------------------------------<br>
    <input type="text" id="id2" placeholder="测试一下">
    <input type="button" id="id1" value="单击">
    -----------------------------------------------------
    <input type="button" id="id3" value="失去焦点">
    <input type="button" id="id4" value="获得焦点">
<form action="${pageContext.request.contextPath}/h/hello1" method="post">
    id:<input type="text" name="id" ><br>
    name:<input type="text" name="name"><br>
    money:<input type="text" name="money"><br>
    <input type="submit" value="提交">
</form>
    -----------------------------------------------------
<form action="${pageContext.request.contextPath}/h/hello2" method="get">
        id:<input type="text" name="id"><br>
        name:<input type="text" name="name"><br>
        money:<input type="text" name="money"><br>
        <input type="submit" value="提交">
</form>

------------------------------------------------------------

<form action="${pageContext.request.contextPath}/date/testDate" method="post">

    date:<input type="date" name="date">
    <input type="submit" value="提交">
</form>
</body>
</html>
